import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}

export function register(data) {
  return request({
    url: '/user/info',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/user/info',
    method: 'get'
  })
}

export function updateInfo(data) {
  return request({
    url: '/user/info',
    method: 'put',
    data
  })
}

// export function getUserInfo(id) {
//   return request({
//     url: '/user/userInfo/' + id,
//     method: 'get'
//   })
// }

export function getUsers(data) {
  return request({
    url: '/user/users',
    method: 'post',
    data
  })
}

export function updatePwd(data){
  return request({
    url: '/user/updatePwd',
    method: 'put',
    data
  })
}


export function logout() {
  return request({
    url: '/user/logout',
    method: 'delete'
  })
}
